package router

import (
	"api-gateway/basic/middwhere"
	"api-gateway/consts"
	"api-gateway/handler/api"
	"api-gateway/pkg"
	"github.com/gin-gonic/gin"
)

func Router() *gin.Engine {
	r := gin.Default()
	r.POST("/login", api.Longin)

	r.Use(middwhere.MiddWhere())
	mid := r.Use(pkg.GetToken(consts.JWT_KEY))
	mid.POST("goodshopAdd", api.CreateGoodShopwindow)
	r.POST("/type", api.Type)
	r.POST("/typelist", api.TypeList)
	r.POST("/goodstatus", api.GoodStatus)
	r.POST("/goodwindowstatus", api.GoodwindowStatus)
	r.POST("/orderAdd", api.OrderAdd)
	return r
}
